package com.entity;

import javax.persistence.*;
import lombok.*;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Table(name = "engineer_project_progress")
@Getter @Setter @NoArgsConstructor
public class EngineerProjectProgress extends BaseEntity {

    @Column(name = "project_id", nullable = false)
    private Integer projectId;

    @Column(name = "progress_date", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date progressDate;

    @Column(name = "completion_percentage", nullable = false, precision = 5, scale = 2)
    private BigDecimal completionPercentage;

    @Column(name = "total_income", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal totalIncome;

    @Column(name = "total_expense", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal totalExpense;

    @Column(name = "profit", precision = 15, scale = 2, insertable = false, updatable = false)
    private BigDecimal profit;

    @Column(name = "progress_description", columnDefinition = "TEXT")
    private String progressDescription;

}